<div class="page-body">
    <div class="row">
        <div class="col-xs-12 col-md-12">
            <div class="widget">
                <div class="widget-header ">
                    <span class="widget-caption">活动列表</span>
                    <div class="widget-buttons">
                        <a href="#" data-toggle="maximize">
                            <i class="fa fa-expand"></i>
                        </a>
                        <a href="#" data-toggle="collapse">
                            <i class="fa fa-minus"></i>
                        </a>
                        <a href="#" data-toggle="dispose">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="widget-body">
                    <div class="table-toolbar">
                        <form method="get" action="{:U('index')}" class="form-inline pull-right" role="form">

                            <div class="form-group">

                                <div class="input-group">
                                    <span class="input-group-addon">
                                        <i class="fa fa-calendar"></i>
                                    </span>
                                    <input type="text" class="form-control active" name="interval_time" id="interval_time" value="{$Think.get.interval_time}" placeholder="根据活动开始时间筛选">
                                </div>

                                <select class="form-control" name="activity_id">
                                    <option value="0">根据活动筛选</option>
                                    <volist name="activity" id="vo">
                                        <option value="{$vo.activity_id}" <eq name="Think.get.activity_id" value="$vo.activity_id">selected=selected</eq> >{$vo.title}</option>
                                    </volist>
                                </select>
                            </div>
                            <button type="submit" class="btn btn-info">筛选</button>
                            <a href="{:U('export')}" class="btn btn-danger">导出</a>
                        </form>
                    </div>
                    <table class="table table-striped table-hover">
                        <thead>
                        <tr>
                            <th>会员卡号</th>
                            <th>ID</th>
                            <th>报名人</th>
                            <th>所报活动</th>
                            <th>支付信息</th>
                            <th>联系信息</th>
                            <th>退款</th>
                        </tr>
                        </thead>

                        <tbody>
                        <foreach name="data" item="v">
                            <tr>
                                <td>{$v.card_id}</td>
                                <td>
                                    {$v.apply_id}
                                </td>
                                <td>
                                    {$v.user.nickname}<br>
                                </td>
                                <td>
                                    <a href="{:U('Activity/index',['keywords'=>$v['activity']['title']])}">{$v.activity.title}</a><br>
                                    活动时间：{$v.activity.activity_start}
                                </td>
                                <td>
                                    支付方式：{$v.pay.way}<br>
                                    金额：{$v.pay.money}<br>
                                    {$v.pay.summary}
                                </td>
                                <td>
                                    联系人：{:json_decode($v['contactor'])->name}<br>
                                    联系电话：{:json_decode($v['contactor'])->phone}
                                </td>
                                <td>
                                    <eq name="v.is_refund" value="0">
                                        <a class="btn btn-danger btn-xs modify-btn" href="/index/Refund/index/id/{$v.apply_id}/type/3">
                                            退款
                                        </a>
                                        <else/>
                                        已退款
                                    </eq>
                                </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                    {$page}
                    <form class="form-inline" method="post">
                        <div class="form-group">
                            <div class="input-group">
                                <div class="input-group-addon">设置页码</div>
                                <input class="form-control" type="text" placeholder="" name="p" value="{$Think.get.p}" style="width: 60px;">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/admin/js/datetime/moment.js"></script>
<script src="/admin/js/datetime/daterangepicker.js"></script>
<script>

    $('#interval_time').daterangepicker({
        format: "YYYY-MM-DD",
        separator: "~",
        locale: {
            applyLabel: '确定',
            cancelLabel: '取消',
            fromLabel: '开始时间',
            toLabel: '结束时间'
        }
    });
</script>